!function (e, t) {
    var f = {
        defaultConf: {
            resizeEl: null,
            draggerEl: null,
            minWith: 0,
            minHeight: 0,
            maxWith: 0,
            maxHeight: 0,
            allowResizeWidth: !0,
            allowResizeHeight: !0,
            mustGtInitWidth: !1,
            mustGtInitHeight: !1,
            mousemoveCallback: e.noop,
            mouseupCallback: e.noop
        }, initWidth: 0, initHeight: 0, dragging: !1, leftOffset: 0, topOffset: 0, init: function (t) {
            this.opts = e.extend({}, this.defaultConf, t), this.dragging = !1, this.resizeEl = e(this.opts.resizeEl), this.draggerEl = e(this.opts.draggerEl), this.initWidth = this.resizeEl.width(), this.initHeight = this.resizeEl.height(), e(document).on("mousedown", this.draggerEl.selector, this.mousedown), e(document).on("mousemove", this.mousemove), e(document).on("mouseup", this.mouseup)
        }, mousedown: function () {
            var t = f;
            t.dragging = !0, t.leftOffset = t.resizeEl.offset().left, t.topOffset = t.resizeEl.offset().top
        }, mousemove: function (t) {
            var e, i, o, s, n = f;
            n.dragging && (e = t.pageX, i = t.pageY, n.opts.allowResizeWidth && (o = !0, (e <= n.leftOffset || e - n.leftOffset < n.opts.minWith || 0 < n.opts.maxWith && e - n.leftOffset > n.opts.maxWith || n.opts.mustGtInitWidth && e - n.leftOffset < n.initWidth) && (o = !1), o && n.resizeEl.width(e - n.leftOffset + "px")), n.opts.allowResizeHeight && (s = !0, (i <= n.topOffset || i - n.topOffset < n.opts.minHeight || 0 < n.opts.maxHeight && i - n.topOffset > n.opts.maxHeight || n.opts.mustGtInitHeight && i - n.topOffset < n.initHeight) && (s = !1), s && n.resizeEl.height(i - n.topOffset + "px")), "function" == typeof n.opts.mousemoveCallback && n.opts.mousemoveCallback(t))
        }, mouseup: function (t) {
            var e = f;
            t.preventDefault(), e.dragging && (e.dragging = !1, "function" == typeof e.opts.mouseupCallback && e.opts.mouseupCallback(t))
        }, destroy: function () {
            e(document).off("mousedown", this.draggerEl.selector, this.mousedown), e(document).off("mousemove", this.mousemove), e(document).off("mouseup", this.mouseup)
        }
    };
    t.dropResize = f
}(window.jQuery || window.$, window);